// ++++++++++++++++++++++++++++++++++++++++
// 《零基础Go语言算法实战》源码
// ++++++++++++++++++++++++++++++++++++++++
// Author:廖显东（ShirDon）
// Blog:https://www.shirdon.com/
// Gitee:https://gitee.com/shirdonl/goAlgorithms.git
// Buy link :https://item.jd.com/14101229.html
// ++++++++++++++++++++++++++++++++++++++++

package main

import (
	"strings"
)

func isRegroup(str1, str2 string) bool {
	strLen1 := len([]rune(str1))
	strLen2 := len([]rune(str2))

	if strLen1 > 5000 || strLen2 > 5000 || strLen1 != strLen2 {
		return false
	}

	for _, v := range str1 {
		if strings.Count(str1, string(v)) != strings.Count(str2, string(v)) {
			return false
		}
	}
	return true
}
